package integerTree;

public class IntegerTreeTester {
    public static void main(String[] args) throws Exception {
        //int[] arr = {1, 3, 5, 7, 9, 4, 1, 45};
        int[] arr = {9, 45, 8, 11, 44, 50, 7, 13, 6, 12, 49, 55, 55, 55, 44, 11};

        BinaryTreeBuilder tb = new TreeBuilder();

        System.out.println("Determined tree:");
        Tree tree = tb.TreeBuild(arr, 10);
        System.out.println("Depth order :");
        tree.printInDepthOrder();
        System.out.println("Breadth order:");
        tree.printBreadthOrder();
        System.out.println("\n");

        tree.removeNode(11);
        tree.removeNode(13);
        tree.removeNode(1);
        System.out.println("rm #11, #13, #1:");
        tree.printBreadthOrder();
        System.out.println("\n");

        tree.removeNode(55);
        tree.removeNode(10);
        System.out.println("rm #50, #10:");
        tree.printBreadthOrder();
        System.out.println("\n");

        tree.insertNode(20);
        tree.insertNode(35);
        System.out.println("INS #20, #35:");
        tree.printBreadthOrder();
        System.out.println("\n");

        System.out.println("Random tree:");
        Tree treeRandom = tb.RandomTreeBuild(10, Integer.MAX_VALUE / 2);

        treeRandom.printInDepthOrder();
    }
}
